From: Gleb Popov <6yearold@gmail.com> Date: Mon, 24 Feb 2025 16:24:07 +0000 (+0300) Subject: [PATCH] Fix a memory leak by actually freeing a correct pointer X-Git-Tag: archive/raspbian/24.12.3-2+rpi1^2~2 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=7279452486b95bf157a75fda74744c7fd7b02e44;p=kpmcore.git [PATCH] Fix a memory leak by actually freeing a correct pointer Gbp-Pq: Name upstream_8b4b5c86_Fix-a-memory-leak-by-actually-freeing-a-correct-pointer.patch --- diff --git a/src/plugins/sfdisk/sfdiskbackend.cpp b/src/plugins/sfdisk/sfdiskbackend.cpp index 3c4b900..e47c4e5 100644 --- a/src/plugins/sfdisk/sfdiskbackend.cpp +++ b/src/plugins/sfdisk/sfdiskbackend.cpp @@ -108,7 +108,7 @@ QList SfdiskBackend::scanDevices(const ScanFlags scanFlags) result.append(device); } } - + } VolumeManagerDevice::scanDevices(result); // scan all types of VolumeManagerDevices @@ -337,8 +337,8 @@ void SfdiskBackend::scanWholeDevicePartition(Device& d) { Partition *partition = scanPartition(d, partitionNode, firstSector, lastSector, QString(), false); if (partition->fileSystem().type() == FileSystem::Type::Unknown) { - setPartitionTableForDevice(d, nullptr); delete d.partitionTable(); + setPartitionTableForDevice(d, nullptr); } if (!partition->roles().has(PartitionRole::Luks))